#ifndef SIMPLETCPSOCKETDLL_GLOBAL_H
#define SIMPLETCPSOCKETDLL_GLOBAL_H

#include <QtCore/qglobal.h>

#if defined(SIMPLETCPSOCKETDLL_LIBRARY)
#  define SIMPLETCPSOCKETDLLSHARED_EXPORT Q_DECL_EXPORT
#else
#  define SIMPLETCPSOCKETDLLSHARED_EXPORT Q_DECL_IMPORT
#endif

#define LOOPRUN_STATECHANGE 1
#define LOOPRUN_SEND 2
#define LOOPRUN_RECEIVE 3
#define LOOPRUN_DEFAULT_ALL 4

SIMPLETCPSOCKETDLLSHARED_EXPORT bool  COM_InstanceExist();

SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_ComInstanceInit();
SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_ComInstanceRelease();
SIMPLETCPSOCKETDLLSHARED_EXPORT void  COM_clientMainThreadLoopRun(short type);

SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_addTcpClient(const QString ip,const int port,int &Order);
SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_removeTcpClient(const int Order);

SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_connectToServer(const int Order);
SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_disConnectToServer(const int Order);

SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_clientSendData(const int Order,QByteArray Data);
SIMPLETCPSOCKETDLLSHARED_EXPORT short COM_clientReadData(const int Order,QByteArray& Data);

SIMPLETCPSOCKETDLLSHARED_EXPORT bool COM_getClientConnectStatus(const int Order);
SIMPLETCPSOCKETDLLSHARED_EXPORT bool COM_getClientReadStatus(const int Order);
SIMPLETCPSOCKETDLLSHARED_EXPORT bool COM_getClientSendStatus(const int Order);


#endif // SIMPLETCPSOCKETDLL_GLOBAL_H
